-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Implement the calculation of tokens amounts #331
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest to refactor the calculation completely
Also cycle is the "larger" value
1 cycle == 4 periods, as in the web interface
1 cycle = 4 weeks for example
1 cycle = 30 days = 1 moon cycle, 1 period = 1/4 cycle
Please use these accessors to conver the asset values into doubles - I added computed values to ProposalModelDetails |
# Conflicts: # lib/ui/proposals/details/components/proposal_details_view.dart
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good now
I wonder if cycle duration also comes with settings?
I saw you're getting period seconds from settings now... maybe cycle seconds are there too? Would be more accurate.
Once we start testing we need to compare the amounts with the web to make sure it's the same.
@n13 cycle duration doesn't exist in the settings. I followed the web implementation, and they set its value statically as i did on the mobile |
Implemented dynamic token amount updates based on the toggle switch to calculate the token amount per period or for one cycle, ensuring proper handling of cases where no tokens are available. When tokens are absent, the toggle switch and token-related UI elements are hidden to enhance the user experience by only displaying relevant information.
Screenshots